import json

import requests
import re
from bs4 import BeautifulSoup




# url = "https://www.zongheng.com/api/rank/details"

headers = {
    "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
    "accept":"application/json, text/javascript, */*; q=0.01",
    "referer":"https://www.zongheng.com/rank?nav=one-day-update&rankType=10",
    "cookie":"ZHID=8F7A9FB0057BF9A7D751B60ADE39F61E; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22198c16a6e692b-0febf52c1c84508-26011051-1654975-198c16a6e6aee%22%2C%22%24device_id%22%3A%22198c16a6e692b-0febf52c1c84508-26011051-1654975-198c16a6e6aee%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%7D; __zhpp=3B35BD283EF2706B1DB6D08CF8CBF227; _c_WBKFRo=uyKWkIvcZd0PxUkjGYxyjeIoOHn6l74iOOi6eQfZ; logon=ODc3OTQ2MTY%3D%7CMA%3D%3D%7C%7C5Lmm5Y%2BLNzkwNTQ4OTM%3D%7CdHJ1ZQ%3D%3D%7CMTQ2NDM4MjQyMQ%3D%3D%7C2147D4629FD9C671B9F7A1D9C4A08065; __logon__=ODc3OTQ2MTY%3D%7CMA%3D%3D%7C%7C5Lmm5Y%2BLNzkwNTQ4OTM%3D%7CdHJ1ZQ%3D%3D%7CMTQ2NDM4MjQyMQ%3D%3D%7C2147D4629FD9C671B9F7A1D9C4A08065; __zhs__=6d0998719a53f65a9fdb0baa32a0ec0d8e1dfd460bc6ce7c1b6e4664460a19b557c2c84ee7ef3716adc2a3691fe83cd50d10fb89137f4bb91b3d3b8ae9eff95eb16bbfbddf9c8a31775e203a2b4f1a430254bc4f407ace70be09ef6dea598f87efeb7472bb7fc5c48be32bb6bdccc8f1c46a648cb14f50e676efd55d3e50ab8634f9a7f08365bf672a20b4e41812b51b78df62d1b78177d953e95ede997166c5a82e9b3929dabe83256a644d943a9d610a117fcc93e25a35cb4e9763398ac8c0783e8237d4db4e5bf532f825ace0b1964c2c52d94ac5b946253a41d631979c81b0d3273a2e8f7524ec741fc3050c2cd70527c87e949730abbd0730025b55655d; __zhc__=30820122300d06092a864886f70d01010105000382010f003082010a0282010100b0c027bac336c0b0033eb80bdaabdd00c46e8fe859ebbe81775b0be7378a8ced0ea09c39fafda03b6c6e10c67f5fa319efaf6887e93a2d5ba9bffb478e8a618e1c54606aa703611cb103be1b11af52db834d12a35920175c9a0fb292de911e07bcb7ba28585ecf3f1989908252b766bb1c8f402ba882888a9746eeb489e17a2faf935da182b22f5337537e233e64a066502e8da35af2b14f3661c411ff7a778eaccd7afaa93442087fdbcd69807b58294bc243e4f66e4de0665665ebf76a01dc5c060d98a606190ee0c17d2dbf84a1c46851b3d0ab67b4d99d04f810d61776e5391714faa6b5d39ac0eb80a0d8a280b49c9b0d2cd9bfd4a18525a72a7e54732b0203010001; loginphone=13526050947; acw_tc=2760820617616533746595404eb9455cf98bc46075f782c8f29472c0094d2c"
}

url = 'https://www.zongheng.com/rank?nav=default'

response = requests.get(url,headers=headers)
if response.status_code == 200:
    result = re.findall(r'<a title="(.*?)" href="//(.*?)" class="global-hover" data-v-9eac7de2>.*?</a>',response.text,re.S)
    for item in result:
        print(item)









